<?php

namespace app\admin\command;

use app\common\util\Tools;
use think\console\Input;
use think\console\Output;
use think\facade\Log;

class OrderTest extends CommonTest
{

    //再命令窗口中执行“php think interface-OrderTest”
    protected function configure()
    {
        $this->setName('interface-OrderTest')
            ->setDescription('接口测试');
    }

    public function execute(Input $input, Output $output)
    {
        parent::execute($input, $output);

        //Route::any('admin/order/getPageList', 'admin/order/getOrderList');                                                      // 订单列表，分页功能
//        $data = Tools::curl($this->url . "admin/order/getPageList", json_encode(["token" => "$this->token"]));
//        Log::write("post". var_export($data,true));
//        echo $data . "\n\n";

        //Route::any('admin/order/getDetailsById', 'admin/order/getOrderDetail');                                                 // 订单详细信息
//        $data = Tools::curl($this->url . "admin/order/getDetailsById", json_encode(["token" => "$this->token", "id" => 1]));
//        Log::write("post". var_export($data,true));
//        echo $data . "\n\n";

        //Route::any('admin/order/cancelFeeRuleSetting/:_type', 'admin/order/doCancelFeeRuleSetting');                            // 订单取消费用规则设置
//        $data = Tools::curl($this->url . "admin/order/cancelFeeRuleSetting/obtain", json_encode(["token" => "$this->token", "id" => 1]));
//        Log::write("post". var_export($data,true));
//        echo $data . "\n\n";
//        $data = Tools::curl($this->url . "admin/order/cancelFeeRuleSetting/del", json_encode(["token" => "$this->token", "hour" => "34"]));
//        Log::write("post". var_export($data,true));
//        echo $data . "\n\n";
//        $data = Tools::curl($this->url . "admin/order/cancelFeeRuleSetting/save", json_encode(["token" => "$this->token", "hour" => "3", "feeRatio" => "2"]));
//        Log::write("post". var_export($data,true));
//        echo $data . "\n\n";

    }
}
